package Test

import (
	"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
	"github.com/gin-gonic/gin"
)

type ProductApi struct {
}

// CreateProduct 创建产品
func (p *ProductApi) CreateProduct(c *gin.Context) {
	response.OkWithMessage("产品创建成功", c)
}

// GetProduct 获取产品详情
func (p *ProductApi) GetProduct(c *gin.Context) {
	response.OkWithData(map[string]interface{}{
		"id":    1,
		"name":  "示例产品",
		"price": 99.99,
	}, c)
}

// GetProductList 获取产品列表
func (p *ProductApi) GetProductList(c *gin.Context) {
	response.OkWithData([]map[string]interface{}{
		{"id": 1, "name": "产品1", "price": 99.99},
		{"id": 2, "name": "产品2", "price": 199.99},
	}, c)
}

// UpdateProduct 更新产品
func (p *ProductApi) UpdateProduct(c *gin.Context) {
	response.OkWithMessage("产品更新成功", c)
}

// DeleteProduct 删除产品
func (p *ProductApi) DeleteProduct(c *gin.Context) {
	response.OkWithMessage("产品删除成功", c)
}
